<?php $this->pageHeader('Inaktive medlemmer'); ?>
<a href="<?php echo $this->url(array('action' => 'index')) ?>" class="button">Tilbake</a>
<p class="clear"></p>


<?php 
    $this->filterForm->setAttrib('id', 'statistikk-hours-filter');
    $this->filterForm->setMethod('get');
    $this->filterForm->setAction($this->url());
    echo $this->filterForm;
?>

<table>
	<tr>
		<th><a href="javascript:void(0)" onclick="postFilterForm()" title="Sorter på navn">Navn</a></th>
	</tr>
    <?php
    $inactiveCount = 0;
    foreach($this->hoursAndShifts as $row) :
        $name = $this->escape( $row['first_name'] . ' ' . $row['last_name']);
        $inactiveCount++;
    ?>
        <tr>
            <td><a href="<?php echo $this->url(array("module"=>"core","controller"=>"user", "action"=>"view", "id"=>$row["user_id"])); ?>"><?php echo $name ?></a></td>
        </tr>
    <?php endforeach; ?>
    <?php if(!empty($inactiveCount)) { ?>
    <tr>
    	<th>Totalt antall: <?php echo $inactiveCount; ?></th>
    </tr>
    <?php } ?>
</table>

<script language="javascript">
function postFilterForm() {
	var oldSortOrder = ($("#sortorder").val() == '<?php echo Core_Gateway_Statistics::DESC ?>') ? '<?php echo Core_Gateway_Statistics::DESC ?>' : '<?php echo Core_Gateway_Statistics::ASC ?>';
	var sortOrder = (oldSortOrder == '<?php echo Core_Gateway_Statistics::ASC ?>') ? '<?php echo Core_Gateway_Statistics::DESC ?>' : '<?php echo Core_Gateway_Statistics::ASC ?>';
	
	$("#sortorder").val(sortOrder);
	$("#statistikk-hours-filter")[0].submit();
}
</script>
